package mao.leetcode.others.leetcode392;

public class Solution {

    public boolean isSubsequence(String s, String t) {
        if (s.trim().equals("")) return true;
        if (t.trim().equals("")) return false;
        int index_s = 0;
        int length = s.length();
        for (int i = 0; i < t.length(); i++) {
            if (t.charAt(i) == s.charAt(index_s))
                index_s++;
            if (index_s >= length )
               return true;
        }
        return false;
    }
}
